from lib.base import Base

class CreateTable(Base):

    def __init__(self, db, query):
        self._clear_attributes()
        self.db = db
        self.query = self._determine_attributes(query)

    def execute(self):
        print "Running create table: %s" % self.table
        self.db.execute(self.query)
        return True

    def _determine_attributes(self, query):
        query = self._trim_table(query)
        return self.db.format_create_table(self.table, query)